package com.smile.f213;
import java.awt.FlowLayout;
import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JRadioButton;
public class ButtonDemo {
	public static void main(String[] args) {
		JFrame frame = new JFrame("FlowLayout示例程序");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JRadioButton radioFirst = new JRadioButton("按钮一");
		JRadioButton radioSecond = new JRadioButton("按钮二");
		JRadioButton radioThird = new JRadioButton("按钮三");
		
		ButtonGroup group = new ButtonGroup();
		group.add(radioFirst);
		group.add(radioSecond);
		group.add(radioThird);
		
		FlowLayout layout = new FlowLayout();
		frame.getContentPane().setLayout(layout);
		
		frame.getContentPane().add(radioFirst);
		frame.getContentPane().add(radioSecond);
		frame.getContentPane().add(radioThird);
		frame.pack();
		frame.setVisible(true);
	}
}